package exam.day43;

class Generic {
    public <T> T getObject(Class<T> c) throws InstantiationException, IllegalAccessException {
        T t = c.newInstance();
        return t;
    }
}

public class Test1 {
    public static void main(String[] args) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
        Generic generic = new Generic();
        Object object = generic.getObject(Class.forName("java.lang.String"));

    }
}
